<?php
/**
 * Created by PhpStorm.
 * User: newrain
 * Date: 2017/12/1
 * Time: 10:51
 */
class FunduploadModel extends BaseModel
{
    //表名
    protected $table = 'upload_fund';

    //将基金公告和产品基金净值归类
    public static function classifyList($list)
    {
        $list_notice = array();
        $list_net = array();
        if ($list) {
            $commonconf = getCommonConfig('app_attachment_path');
            foreach ($list as $value) {
                if (!empty($value['img_file_path'])) {
                    $value['img_file_path'] = urlencode($commonconf.$value['img_file_path']);
                }
                $value['add_time'] = empty($value['add_time'])?'':date('Y-m-d H:i:s', $value['add_time']);
                if ($value['type'] == 1) {
                    array_push($list_notice, $value);
                } else {
                    array_push($list_net, $value);
                }
            }
        }
        return ['list_notice'=>$list_notice,'list_net'=>$list_net];
    }
}
